added factorial to wed