added origin-destination inversion in reply packet, corrected indexes