Eliminating loops.

Working towards replacing all the loops in the Titanic code.