maybe change this to zipWithIndex, and swap the key, value to be consistent with scala