stripped out much of the code that was unneeded.