implement the replaceByte() and conditional() functions.