Fix bug in protecting against double header file inclusion
Lots of updates to first draft of PoP code. Now working pretty well.
Format code