Implemented a better method for tracing files