Tidy up stuff, added if/else-if/else statements