gradient method was added