Added truthTable function

The functions still needs some work. The format it returns is poor
but the general algorithm is correct.