Added min & max to y-axis

Cleaned up code as well