fixed #17 (added optional precedence relations)