Rotation invariant patterns

- fixed rotation invariant patterns
- huge performance improvement
- code refactorization
Remove unnecessary file