Puzzles 1 and 2

general functionality