stuck :( how to make data formatting a function