modified a bit, added icl function