Drafted the analysis component and fixed bugs in segmentation