yet another assignment on pointers and arrays