redesgn with preview and encoding working