Working version without NA values