code style
code cleanup
better "closest beacon" finder