update with bug fixes and new features

- sorting
- debug per rule