reformat code, repair erros