updated preview order
orgenized code