Added another version which uses an array of the previous N outcomes.