some java work for examples, incomplete