Updated with main() function