added main() function, cosmetic changes