fixed bug in CoordToArray

fixed bug in CoordToArray