cleaned up use of ncdf