Change iter_prefix_items wrapper to prefix_items
Reversed for loop for clarity and correctness
Put indent inside memoize, cleaned up comments