first pass on reading code, both robust and exact