Changed numberofsamples and made a variable which only that needs to be changed. Not sure the initialization will fly though.