Implemented and corrected most of the tests