fix for #28 with negative numbers