added optimization tests
fixed infinite loop on unexpected end of file
generated documentation