Added a load of debug lines

Basically this outputs a load of stuff to the serial port. I'm just
using this to get an idea of where the error lies within the code...