CountWays added to Java