refactored adding of the bias to samples