Fixed for consistency and changed the structure slightly to be more object-oriented. Woohoo