algorithm produced the correct answer