Fixed most of the bugs, output looking (semi) good