There is the last } missing and do-loops require a while that ends the loop.
But it doesn't seem like your script needs a loop so just delete the do
also I think your main part isn't declared right but I'm not so sure about that. I am a beginner myself