Changed function signatures to accept pointers