minor fixes for documentation
substr is slower than brackets