Code now successfully solves the given puzzle.