Changed gui code so that it uses Rect instead of Point and Size