We apply the method of the Smaller Alignment Index (SALI) for determining the ordered or chaotic nature of orbits, on some examples of Hamiltonian systems and symplectic maps. The computation of the SALI for a sample of initial conditions allows us to distinguish easily between regions in the phase space where ordered or chaotic motion occurs. The computation of SALI is performed rather easily: for a given orbit we follow the evolution in time of two different initial deviation vectors computing the norms of the difference (parallel alignment index) and the addition (antiparallel alignment index) of the two normalized vectors. The time evolution of the smaller alignment index reflects clearly the chaotic or ordered nature of the orbit. In general the SALI tends to zero for chaotic orbits, while it fluctuates around non-zero values for ordered orbits. The relationship of this index with the Lyapunov exponent is also discussed.