And if not working

Can you please format your code correctly - it is hard to work out where the indents are.