updates to code cleanups, bug fixes