added max samples count var