added conditionals, not sure if this will work