Improve discrete log