Fixes max and min limits
Adds step control
Cleans code