Added license and main function.