fixed a bug
removed old code