added polynomial detrend which deals with nans
grids now plotting correctly