fixed the format and other bugs