Added old Java implementation