added optimization step to parsing
more documentation