A rewrite of the 2012 code in Java