Some of the functions got tested and corrected