An implementation of a layered clustering algorithm implemented using map reduce