added nearest to bamutils