Use set data structure instead of forward_list.
Add operator overloading in Term class.