Minor tweaks to problem 4 Ruby solution.