Refactored for increased readability/modularity

+ Implemented PlainQueue
+ Added Segment abstract class
- many lines of code thanks to Segment class