updated logic-1