updated for java