Implemented cartesian product and did a few tests