Added dynamic scale to y axis

Cleaned up variables