use dec instead of (- ... 1)