Fully converted to java