Added logic to connect a puzzle and its animations