Couple of bug fixes around distance calculation, what happens when the tile list is empty. Added flag to allow 'infinite' execution