Finish this off properly. Haven't bothered with input validation as it isn't really the point of the exercise.