finished linear decoder