updated based on Prof O'Hallaron's feedback