formatted code, removed old stuff