Handle special cases for negative numbers, updated comments.