Added new way to recognize the y-label increments according to the max y-value.
Added comments to the code.