add conditionals to make tests  pass