works with negative numbers now