On achieving channel capacity in finite-memory channels