add timing calls
correct merge errors
Shift dist calculation to c extension