fixed bugs and corrected stuff