More changes towards sweep loop, out commented unused code