cleaned up error handling for sequencial replay
started adding pattern matching support