Added functions to calculate factorial sequentially and in parallel