implemented decoder, but without part restoring yet