add some java doc and formatting