Added gradients class
added figure function to generate figure 1 in paper.