added Main function