Text this: Random walks in an inhomogeneous one-dimensional medium with reflecting and absorbing barriers