Adding general flow of decoder.