reworked the logic