rewrite paper; minor java fixes