added parameter to factorial