Add comments and put private function at the end