What happened at the end of the Lord of the Flies?

Simon is killed after they think the he is the beast. everyone leaves ralphs group. Ralph accidently kills Piggy after fighting with Jack. They are finally rescued by the naval officer