Updated main() method