Change repeat function to use Option under the hood
Change check function to not use exceptions