added conditionals to testing