First attempt at a complete function for ER G(n,M)