Implement position tracking
Add tests for position tracking