def checkIfInside(rect1, rect2):
    """
    Check if rect2 is inside rect1. The two rect are specified by a vector of 4 elements. 
    The first two are the upper left corner and the last two are the down right corner
    """
    
    # Check if the upper left corner of rect2 is inside rect1
    if(rect2[0] >= rect1[0] and rect2[0] <= rect1[2]):
        if(rect2[1] >= rect1[1] and rect2[1] <= rect1[3]):
            return True
        
    # Check if the upper right corner of rect2 is inside rect1
    if(rect2[2] >= rect1[0] and rect2[2] <= rect1[2]):
        if(rect2[1] >= rect1[1] and rect2[1] <= rect1[3]):
            return True
        
    # Check if the down left corner of rect2 is inside rect1
    if(rect2[0] >= rect1[0] and rect2[0] <= rect1[2]):
        if(rect2[3] >= rect1[1] and rect2[3] <= rect1[3]):
            return True
        
    # Check if the down right corner of rect2 is inside rect1
    if(rect2[2] >= rect1[0] and rect2[2] <= rect1[2]):
        if(rect2[3] >= rect1[1] and rect2[3] <= rect1[3]):
            return True
        
        
    return False