Created a class to replace the struct and did the modifications which go with a class(constructors and destructor)