Got 'find_closest_state' working