make triple add format more generalized