I\'ve been trying multiple ways to run a function in a for in loop and when all have returned to run another function but for some reason it appears the final function is ru