finished spoiler code