some minor cleanup
added comments. moved SegmentAccumulator to alic file.