simplified the code a bit and render a outline in the preview