added logic 1