Updated Minimize and Maximize Functionality