Use each_cons instead of 3 arrays and transpose