Added old java implementation