typecheck functions\!\!\!\! booyah