add problem generator and bug fixes