Layer-switching mechanisms in Sb2Te3