Adds preview functionality