lots of changes
fixed off-by 1 errors for some thread counts, now has a check to prevent, added some more docs