Changed scala lists to arrays. Much faster now.

By changing lists to arrays, this code now runs in under 4 minutes. Give it a try.