more porting to java, more milisecs shaved