A quick tutorial on the code formatting tools is in READ FIRST: How to post and use Wolfram Community .
Subscripts in executable code need help. See the notebook attachment SubscriptedVariables101.nb in thread Global and local variables for suggestions.