Let M be a compact orientable surface with non-empty boundary and with X{M) < 0, and let T = nlM. Let C be the free homotopy class of a closed loop on M and let W = W{C) be a word in a fixed set of generators T which represents C. In this paper we give an algorithm to decide, starting with W, whether C has a simple representative, that is a representative without self-intersections. Such a word will be said to be simple. As an application, we begin a study of simple words in F. Our results also apply to infinite geodesies on M, corresponding to biinfinite words in F, where now we ask which finite blocks appear in such a word when the corresponding infinite homotopy class has a simple representative. For finite words there are, of course, other such algorithms, see for example [8, 9, 2, 3, 4]. Our algorithm most resembles that in [2] in that it is purely mechanical and combinatorial. It is simpler than that in [2] but what is more important is that it reveals the underlying mechanism which determines whether self-intersections occur; the combinatorics of that mechanism seem quite interesting and non-trivial. We represent M as U/T where U ^ D is the universal covering space of M, and where D is the unit disc with the Poincare metric and F is a discrete group of hyperbolic isometries. Poincare showed in [7] that C contains a simple representative if and only if the unique smooth geodesic representative C of C is simple, and that C is simple if and only if for each lift y of C to D the curves in the infinite family {fy}fer a r e pairwise disjoint. Now, to see if geodesies yl5 y2 e {fy} are disjoint in D it is enough to know whether the ideal endpoints of yx on 3D separate those of y2. Crucial to our work is a scheme for parametrizing points on 3D by infinite words in F, first developed by Nielsen in [6]. The idea of this paper is to show how information on the order of the points 3yl53y2 on 3D is encoded in Nielsen's 'boundary expansion' (Theorem A) and then to examine consequences. When dM ± 0 the group F is a free group so that each conjugacy class has a unique shortest representative which is obtained by cyclic reduction of any word in the class. However, if dM = 0 the shortest word in the conjugacy class is in general not unique. If dM = 0 and W e T has a shortest representative which does not contain any pieces which are half of the defining relator in F, then the problem of deciding whether W is simple is identical with that on the surface with a disc removed, that is one simply regards F as if it were a free group. On the other hand, the exceptional cases when W contains half a relator involve some subtle points which are not without interest, but are somewhat tangential to the main idea in the paper. For that reason, we shall omit the case in which dM = 0 . Here is an outline of this paper. The tools we need are set up in §§2 and 3 where we prove Theorem A. The algorithm (Theorem B) is given in §4. In §5 we give