fix for negative numbers