finish the code, seems all right