a THREES implementation in Java