fix for pointer

pass the slice into the function to make it more readable.