def boundary_overflow(posX, posY):
    """
    Correct coordinates for boudary overflow
    Treating the 8x8 boundaries as if they don't exist.
    (8,8) is the same as (0,0), (-1,-1) same as (7,7)
    """
    x_field = posX
    y_field = posY
    
    if x_field > 7:
        x_field = 0
    if x_field < 0:
        x_field = 7
    if y_field > 7:
        y_field = 0
    if y_field < 0:
        y_field = 7
        
    return [x_field, y_field]