Clean up and fix some codes
Merge pull request #36 from 19506jk/Code_Cleanup

Clean up and fix some codes