added debug boolean to turn off Serial debugging