added conditionals and if statement