updated design and format of code

commented and beautified code , deleted obsolete files