Updated factorial code to pass first two tests