grid zipping added and refactoring
removed old type-level functions not used anymore