Made the if statements a little bit neater.