Adding few more functions and correcting errors