Retreating ice sheets, many millennia ago, deposited their glacial debris behind the hard volcanic plug of the castle rock on which Edinburgh Castle stands, resulting in a distinctive crag and tail formation. Running eastwards from the crag on which the castle sits, the Royal Mile sits upon the ridge of the tail which slopes gently down to Holyrood Palace. Steep closes (or alleyways) run between the many tall lands (or tenement buildings) off the main thoroughfare. The route runs from an elevation of above sea level at the palace to at the castle, giving an average gradient of 4.1%.