added looping function, and last track knowledge.