another stab at integrating Emily's changes