implemented new perimeter traversal as part of sweep opimization