Beginning adaptation for eric's code