init and preview