Using an if-else statement to execute alternate code