The calls that were on top of the function have also been moved to the bottom for safety (see previous commit)