Logic updated