Added some debugging messages and modified LED output.