Can somebody explain what happened in the end? I got confused