Logic changes

Logic changes