updated with if statements