updated python factorial