FIX ENDINGS, FINISH REPLAY FUNCTION.

The first ending is always chosen for some reason.