added constructor and parameters to add method