Added changes from @colvinc2