all code regarding puzzle solving