Fixed code for regionA of the toric code