rewrote hungarian for flat rep.