fold lines with functions