I have this 2 functions i tried to put the repeated variables and constants out of them so they both use one single version from the global scope, but once I removed the vars f