Removed old unneded code
Some cleaning up and commenting