Added some if statements to main