cleaning up the code

just rearrange the code and deleted some blank lines