java impl by C-MED