In this paper, we study the two dimensional motion of three linked rigid bodies moving through a fluid which may be infinite in extent or confined to a tank under gravity with Reynolds number in the range . The motion of the bodies is determined by specifying the angles between them as functions of time so that the resultant motion mimics the swimming of fish. In contrast to previous simulations, the bodies are connected by an elastic skin that alters the flow around them and gives the appearance, and some of the properties, of swimming fish. We show that, as expected, the presence of the skin reduces the energy required to move the linked body system a specified distance in a specified time. We simulate the system with the particle method Smoothed Particle Hydrodynamics (SPH), using three types of particles: fluid particles, boundary force particles, and skin particles. These particles interact by means of pair forces along their line of centres. Our treatment of the rigid and elastic boundaries is related to the immersed boundary method, but differs from it in detail. We compare the motion of rigid bodies with and without skin and determine how the speed and power output depends on the presence or absence of skin, and whether the bodies are more like an eel or a mackerel. We apply our model to study swimming under gravity near a free surface or a rigid bottom boundary in a tank and determine the scaling relations for the speed and power generated. The scaling relation for speed is remarkably similar to that known for aquatic swimming. The optimum strategy for the gait we use, measured in terms of least energy per unit distance, is to swim as close as possible to the free surface without causing large wave breaking. The algorithm is simple and robust and can be applied to bodies of arbitrary shape.