Added program6, MongoDB functionality, refactoring.