refactor and add frequent encounter problems.