code clean up and detective work.