ln function
fix some bug in ln