Misc bits of code to solve misc puzzles