added a main() function