more modularity by yielding orders instead of printing and returning