Solution to parity problem (5.1)

This adds the solution to 5.1 parity problem. It also checks in the Intellij IDE files in case you want to import directly into Intellij.