My day9 solution was ugly. So I put the ugliest bit through ChatGPT and it really improved it. The new pos() function. But it didn't work so I had to manually fix it. Anyway it was far better after than before.