Where was the castle located in which is related to William Douglas and Margaret Hay?