public void Run()
	{
		// make sure game started properly
		if (Initialize())
		{			
			while(mIsRunning)
			{				
				// handles window events
				Display.update(true);
				
				mGameTime.Update();
				
				while (Keyboard.next())
				{
					GameProperties.GetInputHandler().HandleKeyboardEvent();
					gameStates.peek().HandleKeyboardEvent();
				}
				
				while (Mouse.next())
				{
					GameProperties.GetInputHandler().HandleMouseEvent();
					gameStates.peek().HandleMouseEvent();
				}
				
				// if the top gamestate is alive, update, otherwise remove it
				if (gameStates.peek().IsAlive() != false)
				{
					gameStates.peek().Update(mGameTime);
				}
				else
				{
					gameStates.pop();
					
					// if there are no more game-states, end the game, otherwise update the new top
					if (!gameStates.empty())
					{
						gameStates.peek().Update(mGameTime);
					}
					else
					{
						mIsRunning = false;
						break;
					}
				}
				
				// clear screen and set modelview matrix
				glClear(GL_COLOR_BUFFER_BIT);
				glMatrixMode(GL_MODELVIEW);
				glLoadIdentity();
				ClearScreen();
				
				// draw top gamestate
				gameStates.peek().Draw();
				
				if ((Boolean)GameProperties.GetVariable("is_fps_capped").GetData())
				{
					// delay for constant framerate
					Display.sync((Integer)GameProperties.GetVariable("fps_cap").GetData());
				}
				
				// handle close message
				if (Display.isCloseRequested())
				{
					mIsRunning = false;
				}
				
				// handle adding a new state if current state requests a new state
				if (gameStates.peek().IsNextState())
				{
					gameStates.push(gameStates.peek().TakeNextState());
				}
			}
		}
		else
		{
			System.out.println("Failed To Initialize!");
		}
		
		// close display
		Display.destroy();
		
		System.exit(0);
	}