Made TimeQueue generic