updates to gradient and optimization method