Add position tracking and better errors