The answer to this is older, but it's not a proven fact even though schools teach it as if it were. It is still just a theory if you think about it with how much the earth moves, areas of rock could be complete upside down and no one would know, it would be like history in reverse.
you got them correctly gods jod
UV rays reacting with the O2 molecules
I might be wrong a little but
Hope the helps :)