tweaked based on Nan's feedback