updates to codebase and bug fixes