Added System.out.println messages to help debugging.