Cleaned up class and made sort a public function.