-- started new error handling for extract function; removing assertions