added conditionals with tests