Added a more reasonable way of using functions again in other functions, also fixed the timer function