in reply to hoh - print in the inserted order
Push the keys onto an array, and use it to drive the print loop.