translating data structure into java