improve the code and rewrite the last comments in english