add log support
add log support, K=5 seems to be the best