Do not use hard coded L addresses. Create an array of timestamps and use a named variable in the L area. Two positive edge detections also not required.
I have attached a program that does exactly what you want byte by byte. Try it out. If you want to reverse the order, I think the source is included. If not, I can help you with it but you will get the idea.