Added RPi processing code and some cleanup