Changed return types to be the result enum rather than int