Changed the project from eclipse to IntelliJ

I changed the style a little to most of the code.
I also made a few changes and fixed a few bugs.