Update SD-SeGrid-Execute.py

changed looping logic to be simpler