code cleanup, test problem 71, solved problem 231