Added exercise2.pl and some implementation