Move main to function & some lint changes.

* Main moved to function, now lowercase vars.
* Deleted unused vars & other small fixes.