Fixed a ton of errors

Made it look nicer as well, separated some lines and vars and values.