implement with java and py