Move main etc to the top of the file so that the most recent problem is at the bottom.