Working example of passing an array to function, accessing contents