changes to prepare min max