update triple, fix bugs in many parts, fixes #5, fixes #3