implementing 0-1 scaling