added main function definitions