We analyse a hydrodynamical simulation of star formation. Sink particles in the simulations which represent stars show episodic growth, which is presumably accretion from a core that can be regularly replenished in response to the fluctuating conditions in the local environment. The accretion rates follow $dot{m} propto m^{2/3}$, as expected from accretion in a gas-dominated potential, but with substantial variations over-laid on this. The growth times follow an exponential distribution which is tapered at long times due to the finite length of the simulation. The initial collapse masses have an approximately lognormal distribution with already an onset of a power-law at large masses. The sink particle mass function can be reproduced with a non-linear stochastic process, with fluctuating accretion rates $propto m^{2/3}$, a distribution of seed masses and a distribution of growth times. All three factors contribute equally to the form of the final sink mass function. We find that the upper power law tail of the IMF is unrelated to Bondi-Hoyle accretion.