updated comments; code cleanup