removed old code, fixed bug