-reformatted code
-fixed several issues
-optimized code