port to java (in progress)
more porting
nasty signed longs