refactor matrix definitions
fix grid filter file