Got the to_position() bit working. Barely done.