code comments in English, some minor changes