cleanup and documentation, cont.