add factorial method, rename simpleSample to repeat