implement quick sort, alter assert style statements and streamline mechanisms for error reporting.