Tested version

Fixed problem with elimination of transient periods and added minor
improvement to the folding procedure