fixes #5
added support for custom rules