Using else in place of if statement