Fixed a compile error in redundant functiosn index2coord2 and added some comments