made my code more modular by removing functions within another function
Merge branch 'master' of https://github.com/omesanni/FourAngJS