Added support for passing in an arbitrary grid
Forgot this file.