made triples.lua a bit more elegant