added loop in main