Problem 21. Still needs comments and cleanup.