I\'ve managed to modulize and move a bunch of repeating code into functions to reduce the length of my program. But an issue is that this function here:
def s