Removed old code and added some comments