Left some debugging output code in but commented out.