moved segmap recalculation outside of centroid minimization step, implemented timer features to test the effects