make much faster on huge dataset