update to add min max scaling and fix a bug in assign
update to add min max scaling and fix a bug in assign