bug in pattern matching recursive lists fixed.
Rewrote pattern matcher to take care of recursive lists.