breaking down the if tests