add problem 23; could use some improvements to reduce execution time