Included comments, slightly improved folding, corrected offsets of 1