Reversing all animations except newest

I am making a maze game that closes paths as you walk though them each path closure is an animation tied to a trigger object. I want to make it so that only the newest animation exists at a time and that all older changes revert back to normal. but cant seem to get the code or placement of the code right. it is a 3d game using a first person controller. thanks for any help.

What you may find usefull is the explanation of working with classic sorting algorithms to see what it's all about. It's not a good idea to summarize that because often times people can miss critical details that ,to them are redundant, but to the student/colleague/scholar are critical.

http://www.codeproject.com/KB/cs/Search_Sort_Algorithms.aspx