Added state generation of constructor + added support for add(x,y) and sub(x,y).