Cleaning up the code

-Removed all unused variables and imports
-Renamed all build-in symbols expect for the InvalidParameter class
-Removed most of the unnecessary code that was commented out.