Added modularity and else statement