decoding... and checks