Add code comments for rewrite