a java demo using depth searching