Fix closest sources

Cleaned up this code