Fixed and checked for accuracy the sample 2d array