some logical changes