fix coedit bugs
add comment to the code