Replacing if's with else if's