<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Compare two strings and return "bigger", "smaller" or "equal" depending on the lexicographical order.
string1 = "zebra"
string2 = "zeal"<|im_end|>
<|im_start|>assistant
def compare_strings(string1, string2):
    i = 0
    length = min(len(string1), len(string2))

    while i < length:
        if string1[i] < string2[i]:
            return 'smaller'
        elif string1[i] > string2[i]:
            return 'bigger'
        i += 1
    
    if len(string1) > len(string2):
        return 'bigger'
    else:
        return 'equal'<|im_end|>
