Added minimize functionality.