Implement less memory hungry idw.