Improved perfomance of segmentation method

Performance has been improved in 475 times!!!!!