Programmed in Prolog, quite simple as long as remember full stops etc.