decided that functions have to be addressed before if-else branching