Grid model implement

Implemented and tested gridModel functionality.