Copied states number for number

(forgot about reference based)
added some debug print outs