Adding code for the prolog assignment