added constructor and object printingmethod