Logarithmic

this should work(I didn't have time to modify the code since the last time you read it, I'll do any new modification on the original repo)