Problem 24

Updated to make the loop work after all.