x2 log function
fix the log problem
change some codes to meet the requirements