I think this could help you go in the right direction. Probably slightly modified rule sets based on this