Here you go, I've edited your example and this should work for you.
You had a small memory leak in there by continually increasing the size of the player position array. I have also changed the way the data is inserted into the array so that each tail sprite obtains its position data from the position array according to its position number and a time delay that you can edit using a local variable.