Added version that allocates reply var dynamically.