Added alpha support to gradient method.