Changed raspi code to match Andrew's alg