Had to shuffle around some functions that were placed in the wrong files