re-wrote in Java 8 lambda form.