added complex processing function