Added booleans to the if statements