Add function 'makerule' from Mark

Add acceptance test