working on triples code