added exhaustive pattern match heuristic (useful only for very small examples)