removed wars and the repeated segmentation calls: improved performance\!