proper preview, remove debug code