made it simpler for miguel. make sure to reset COMMAND_INDEX to zero after creating processes and commands