partial implementation

reading in the segment length correctly, had to roll my own char to int
converter because neight the c++ or the c library were compiling