Troubleshooting pointer

Isolated issues with the nested for loop