Tested that script can stand on its own.
Added main function
Fixes