closes #29
start clustering during map, reformat code