Grid model implementation

Sample pull request.