implemete recursive complement