added doc comments. minor cleanups