Convergence properties of the Barzilai and Borwein gradient method