added main() boilerplate
made the right variable global