corrected bug when ln deals with negative numbers
added inversion in the basic operations