Main function created