Fixed the output, made it neat. Fixed some bugs.