added very important optimization alteration
finished code for experiment 1 as seen in google drive doc