Add closest_piece helper

Simplifies some logic and is much easier to read (for me at least :).