change condition to subscripts, remove TODOs