java doc updated and moved inner class to end.