All of this code comes straight from my raspberry pi.