just moved main code after function definition