Imlemented part 2 (f and learn) with the graphs done as well