Can be optimized even further if somebody wants to look into the most optimal way to solve some of these puzzles