put "else if" on the same line as the preceding }. similarly for the last "else"