added preview implementation