fix code and create document