added samples counting