got a rudimentary version of decode working