Improved Coding style and some minor changes to namings.