changin function to take statements, call graph, and pointer analysis as parameters
this is because the statement supplied probably has to be from the same call graph used to find the slices.