Generalized for any binary graphene structure.  Appears to be working correctly.