Der Fehler an dem Code dürfte sein, dass "Variable" in Bit und kein Byte ist.