major updates, code changes and clean up