Made stopanims function more efficient and faster

Instead of computing the list length every time through the loop,
compute it once at the beginning - and reduce the time sleeping from
5s to 0.5s