Part 3 (gradient magnitude direction) is done and tested