Fixing if/elif/else statement to be more specific