added ability edit/save apartments
calculating min max values