Lots of experimentation:  

major progress: 
0) Start by optimizing N and packing fraction.   
1) minimize symmetry error over one symmetry operation at a time , all operations 
2) repeat above until M matches all symmetry ops
3) Correct by optimizing N and packing fraction.  Loop to 1