added solution to prob31