starting to build the preview logic