Moving the IssueOrder into the loop below would make things clearer and remove an unnecessary iteration of the orders array.