some code for dealing with ibuttons inR