modified constructor and corrected some of the methods.