Stripping out old code, fixing bug