Adds factorial fn.