made use of roadSegment parameters in viewer; some code improvements/cleanups