removed unneeded code and added more serial debug output