- fix logic for negative numbers