Adding support for basic segmentation
A few fixes
Merge pull request #29 from camertron/segmentation

Segmentation