Main function to invoke sub functions.