St Andrews Castle, Main gatehouse tower