restructured main file
code beautification