from John: Experiment2.java