fixed errors in visual selection

added folding to source, and improved documentation