Initial work on stages 3 and 4 of line parser