added constructor and some methods