Functions_Personal Changes: ifElse statement added to the code