A new algorithm for adaptive arrays