made triples.lua even more elegant!