CHANGED:applied minize/maxium/restor function