2d arrays in c and some recursion