Yeah, that's just an accumulating loop, it's pretty simple really. You don't have whitespace in the right places so the foreach loop doesn't look intuitive, but you should have no trouble understanding this. The two statements below the foreach loop in your pseudo code would essentially be in brackets in a full up programming languages so that they are grouped to run inside the loop. Perhaps you don't understand how functions work? Functions can and do return objects and collections. After this pseudo code you would typically have a printing statement which prints the total, or you would set a variable for the total whether it be an object unto it's self, or simply a variable to hold the currency value.