Implemented crude gradient decent