Problem 7 attempted revisions

Trying to successfully solve problem 7. I suspect that the first function is more efficient.