Added some comments, still need to finish powerset and fix cartesian product