changed some struct names, fputs to printf, comments