define trace method