code is more robust to changing inputs