Updating the main() function