modefied logic