reorganization, eliminated unneeded variables