adding preview functions