logic updated