fix variable names after the in/out mixup
clean up code in get_state_matrix just to make it clearer
dropping the links to other lists in task entries