first function: factorial