logarithm logic and pre added to everything