def delete_from_session():
    """Delete a property from the session.
    Also deletes a property from comparison table
    when it's deleted from session.
    Done with Ajax to take out the property from the table"""

    global RGB_TUPLES 
    global HEX_COLOR_STRINGS

    #delete from session
    props_in_list = session.get('properties',[])
    used_color_map = session.get('used_color_map',{})

    zpid = request.form.get('property') 

    if zpid in props_in_list:
        zpid_index = props_in_list.index(zpid)
        props_in_list.pop(zpid_index)
        if str(zpid) in used_color_map:
            color_map = used_color_map[str(zpid)]
            rgb_tuple = (color_map['r'], color_map['g'], color_map['b'])
            hex_color_string = color_map['hex']
            RGB_TUPLES.append(rgb_tuple)
            HEX_COLOR_STRINGS.append(hex_color_string)
            del used_color_map[str(zpid)]

    zpids_in_table = session.get('comp_table',[])
    if zpid in zpids_in_table:
        zpid_index2 = zpids_in_table.index(zpid)
        zpids_in_table.pop(zpid_index2) 

    return "Victory"