functioning also with test dataset