finally finished... prolog is very interesting