Added gradient ascent support