reimplement with circular list but still need 30s to cmopute one