simplified implementations
simplified implementations
added nearest feature functionality
added comments to functions