fixed bug where position data were not all used