A computer simulation of nucleation