initial implementation pulled from wysiwyg