New documentation, minor optimizations