removing old stuff, fixing logic