added subtract and factorial