OK.
There are a lot of issues in your code for back_substitution() - most of the for-loops are using the wrong ranges, and then you’re using index and value incorrectly.
However, this assignment is being re-written, because it’s too complicated for the educational value it provides.
Please read this thread, and you can decide how you want to proceed.