The castle was extended, and in 1582 the Town's College (the precursor of the University of Edinburgh) was founded.
The castle was extended in the year 1563. 
mnli hypothesis: The castle was extended in the year 1563.  premise: The castle was extended, and in 1582 the Town's College (the precursor of the University of Edinburgh) was founded.