initial working code; c++11 tuples support; almost beta