changed error back to logarithmic (I believe error should be polynomial, but this should work pretty well)