 At the end, when Chekhov asks Kirk for a course heading, Kirk smiles  and says, "Second star to the right and straight on til morning."  That is a reference to the directions Peter Pan gives to get to  Neverland in the classic story "Peter Pan" by J.M. Barrie (qv).  This was originally intended to be the last line of  _Star Trek: The Wrath of Khan (1982)_ (qv); however. that scene was  edited down and ended before reaching those lines.