fixed bug with negative integers