reformated code, removed old code snippets