now the preview width is parameter