improve logic 2