Re added a few if statements.