finished everything but game interface. needs some refactoring.