tested segmentation
Merge https://github.com/odestcj/hackathon_aug2013