I like what you did here for the preview function. Good way to use only one function.