added support for maximization.