working for small and large test set