moved the pqueue into its own file, and simplified the store a bit