The "+1" is wrong - you're this way adding 1 to all prices. But the second if expression is ok.