add log and factorial, and fix bug.