first version without ring buffor