By the way, I just noticed that there is a divide by zero possibility in the code I wrote that should be fixed with an if statement in the logToValue function.