functions: fixed that complicated case