fixed #4 and corrected #10