code cleanup and commenting. /MRG