Completed program. Will refactor.