added main code into master.