Refactored Code & Bugs fixed

All done.