syntax error in fact function