Fixed PEP8 issues
Added the grad_func
Variable change