Iplemented c++ tuple version