fix serious error and made output a little prettier