final versions of code. Need to be tested with a Shield.