moved functions to the top of the script because i'm about to change them and it helps when the versions that're running are the same as the versions that i think are running.