Add main funcition