rewrote method wrapupMarkup(). Has not tested yet.