adding comments and fixing array out of bound bug