added comments for directional_gradient functions
added more comments