setfromto fixed
min max funtion added