Correctness completed. Performance is poor.