Added 'main' function to script