improved trace recognition