Commented out actual code and re-instated code to test gradient magnitude direction.