updated docs, cleaned up comments