Changed the return value of the failure case to a Disciminated Union.