add multi code + comments, fix new ID and infinite distance