Main with target_tile function changed.