added, documented, tested mcFold, a linear-fold function