fix to underflow/overflow!