Merged version of the preview stuff.