Converted to java