6th versio of thr code. New functionality added.