@Override
	public void actionPerformed(ActionEvent e) {

		if ("pause".equals(e.getActionCommand())) {
			if (paused == false) {
				paused = true;
				pauseButton.setText("resume");
				pauseButton.setToolTipText("Resume Simulation");
			} else {
				paused = false;
				pauseButton.setText("pause");
			}
			reverseButton.setEnabled(paused);
			forwardButton.setEnabled(paused);
		}

		else if ("restart".equals(e.getActionCommand())) {
			repaint();
			updateScene();
		}
		
		else if ("faster".equals(e.getActionCommand())) {
			fps+=10;
			refresh=1000/fps;
			timer.stop();
			timer.setDelay(refresh);
			timer.setInitialDelay(10);
			timer.start();
		}

		else if ("slower".equals(e.getActionCommand())) {
			if (fps > 10) {
				fps-=10;
				refresh=1000/fps;
				timer.stop();
				timer.setDelay(refresh);
				timer.setInitialDelay(10);
				timer.start();
			} else if (fps > 1) {
				fps-=1;
				refresh=1000/fps;
				timer.stop();
				timer.setDelay(refresh);
				timer.setInitialDelay(10);
				timer.start();
			}
		}

		else if ("styles".equals(e.getActionCommand())) {
			pickOne = !pickOne;
		}

		else if (!paused) {
			repaint();
			updateScene();
		}
	}