Added funtion main