Adding minimize functionality