Create a simple function for calculating factorials