modifications to niri_redux.py