Added functionality to the close, maximize and minimize buttons.