So I posted a similar question to this, thankfully the community helped me quite a bit. So now I am facing another issue. The code below, starting with the while loop goes throu