cleaned up plot, added functions and scales