fix some bugs and add the answer in the first line so the user can see it faster