fixed bug with negative positions