Minor edits

-Removed unused codes
-Fixed several bugs
-Made codes look beter :)