added version which rearranges data in JS after coord delivery