I'll just rephrase the passage, which will hopefully be helpful.
"I spent four weeks in Brazil competing [presumably at some sport], but didn't do very well, so I went home to figure out how to improve, to do some more training, and to get more motivated to compete. I flew over here by myself, focused completely on winning, and maintained my focus, so everything turned out well."