Fixed some bugs, like blank lines in the beginning when formatting


Modernized a bit