bugs when negative values corrected