Thanks John,
That is a really neat solution, I hadn't considered putting the values in an array and just adding them up.