Changes to code based on RA's feedback