public void updateModel() {
		
		for (Event event : window.pollEvents()) {
			
			if (event.type == Event.Type.CLOSED) {
				window.close();
			}
			
			if (event.type == Event.Type.MOUSE_BUTTON_PRESSED) {
				if (event.asMouseButtonEvent().button == Button.LEFT) {
					scrollMode = true;
					window.setMouseCursorVisible(false);
					leftClickedMousePos = Mouse.getPosition(window);
					Mouse.setPosition(new Vector2i(window.getSize().x/2, window.getSize().y/2), window);
				}
			}
			
			if (event.type == Event.Type.MOUSE_BUTTON_RELEASED) {
				if (event.asMouseButtonEvent().button == Button.LEFT) {
					scrollMode = false;
					window.setMouseCursorVisible(true);
					if (leftClickedMousePos != null) {
						Mouse.setPosition(leftClickedMousePos, window);
					}
				}
			}
			
			if (event.type == Event.Type.MOUSE_MOVED && scrollMode) {
				MouseEvent mEvent = event.asMouseEvent();
				scrollXVelocity = mEvent.position.x - window.getSize().x/2;
				scrollYVelocity = mEvent.position.y - window.getSize().y/2;
			}
			
			if (event.type == Event.Type.MOUSE_MOVED) {
				MouseEvent mEvent = event.asMouseEvent();
				
				if (!Keyboard.isKeyPressed(Key.I) && !Keyboard.isKeyPressed(Key.O)) {
					if (!scrollLeft && !scrollRight && !scrollUp && !scrollDown) {
						updateHoveredOverFloor(mEvent);
					}
				}
			}
			
			if (event.type == Event.Type.KEY_PRESSED) {
				if (event.asKeyEvent().key == Key.LEFT) {
					scrollLeft = true;
					scrollMode = false;
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.RIGHT) {
					scrollRight = true;
					scrollMode = false;
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.UP) {
					scrollUp = true;
					scrollMode = false;
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.DOWN) {
					scrollDown = true;
					scrollMode = false;
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.I) {
					scrollMode = false;
					model.getCurrentView().zoom((float)0.98);
					if (model.getCurrentFloorDetails() != null) {
						model.getCurrentFloorDetails().setHighlighted(false);
					}
					
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.O) {
					scrollMode = false;
					View oldView = model.getCurrentView();
					float oldX = oldView.getSize().x;
					float oldY = oldView.getSize().y;
					
					model.getCurrentView().zoom((float)1.02);
					if (model.getCurrentView().getSize().x > model.getWorldDimensions().width) {
						model.getCurrentView().setSize(model.getWorldDimensions().width, oldY);
					} else {
						if (model.getCurrentView().getSize().y > model.getWorldDimensions().height) {
							model.getCurrentView().setSize(oldX, model.getWorldDimensions().height);
						}
					}
					
					tearDownFloorMenu();
				}
				
				if (event.asKeyEvent().key == Key.W) {
					legendScroll = true;
					scrollLegendYVelocity = 5;
				}
				
				if (event.asKeyEvent().key == Key.S) {
					legendScroll = true;
					scrollLegendYVelocity = -5;
				}
			}
			
			if (event.type == Event.Type.KEY_RELEASED) {
				if (event.asKeyEvent().key == Key.LEFT) {
					scrollMode = false;
					scrollLeft = false;
					scrollXVelocity = -5;
					variableSpeed = StaticControls.directionScrollStartSpeed;
				}
				
				if (event.asKeyEvent().key == Key.RIGHT) {
					scrollMode = false;
					scrollRight = false;
					scrollXVelocity = 5;
					variableSpeed = StaticControls.directionScrollStartSpeed;				
				}
				
				if (event.asKeyEvent().key == Key.UP) {
					scrollMode = false;
					scrollUp = false;
					scrollYVelocity = -5;
					variableSpeed = StaticControls.directionScrollStartSpeed;
				}
				
				if (event.asKeyEvent().key == Key.DOWN) {
					scrollMode = false;
					scrollDown = false;
					scrollYVelocity = 5;
					variableSpeed = StaticControls.directionScrollStartSpeed;
				}
				
				if (event.asKeyEvent().key == Key.W) {
					legendScroll = false;
				}
				
				if (event.asKeyEvent().key == Key.S) {
					legendScroll = false;
				}
			}
		}
		
		scrollModelView();
		scrollLegendView();
		
		if(scrollUp == true){
			variableSpeed = variableSpeed * 1.01;
			moveModelView((float) 0, (float) -variableSpeed);
		}
		
		if(scrollDown == true){
			variableSpeed = variableSpeed * 1.01;
			moveModelView((float) 0, (float) variableSpeed);
		}
		
		if(scrollRight == true){
			variableSpeed = variableSpeed * 1.01;
			moveModelView((float) variableSpeed, (float) 0);
		}
		
		if(scrollLeft == true){
			variableSpeed = variableSpeed * 1.01;
			moveModelView((float) -variableSpeed, (float) 0);
		}
		
		constrainModelViewToWorld();
	}