Solution 8: solve P2

With help of the forum, though :(