Main class to calculate an optimized gradient
Class to store a gradient function
Added validation and gradient calculation
Small modification to the main function