moved a shit ton of functions to generalFunctions.js