subtract one after length check
updated README for variable length and added TOC