All sorts of stuff
Stuff
Finally made subroutines more generic, cutting down on duplicated code