working on more inteligent decoding in the perpetual code