changes from working version on Pi