     }
     self.lastViewportUpdateSize = self.bounds.size
     
-    let fieldOfView: GLfloat = 60
-    let zFar: GLfloat  = 1000
-    let zNear: GLfloat = 0.1
-    var size: GLfloat = zNear * GLfloat(tan(Double(fieldOfView) / 180 * M_PI_2))
-    let rect = self.bounds
-    
-    glFrustumf(-size, size, -size / GLfloat(rect.size.width / rect.size.height), size / GLfloat(rect.size.width / rect.size.height), zNear, zFar)
-    glViewport(0, 0, GLsizei(rect.size.width), GLsizei(rect.size.height))
+    let size = zNear * GLfloat(tan(Double(self.fieldOfView) / 180 * M_PI_2))
+    let sizeByRatio = size / GLfloat(self.bounds.size.width / self.bounds.size.height)
+    
+    glFrustumf(-size, size, -sizeByRatio, sizeByRatio, self.zNear, self.zFar)
+    glViewport(0, 0, GLsizei(self.bounds.size.width), GLsizei(self.bounds.size.height))
     
     // Make the OpenGL modelview matrix the default
     glMatrixMode(GLenum(GL_MODELVIEW))

    glClear(GLenum(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT))
    
    glLoadIdentity()
    glTranslatef(0, -0.1, -1)
    glScalef(3, 3, 3)

    for teapot_indices in teapot_indicies {
      glDrawElements(GLenum(GL_TRIANGLE_STRIP), GLsizei(teapot_indices.count), GLenum(GL_UNSIGNED_SHORT), teapot_indices)

    let matDiffuse: [GLfloat] = [1, 1, 1, 1]
    let matSpecular: [GLfloat] = [1, 1, 1, 1]
    let lightPosition: [GLfloat] = [0, 0, 1, 0]
    let lightShininess: GLfloat = 100
    
    // Configure OpenGL lighting
    glEnable(GLenum(GL_LIGHTING))
