Wrote constructor and methods