Implementing linear decoder.