fixing bugs in the representation + adding some comments