update code to include serial output for debug