added main code:works