A Monte-Carlo Simulation of the Stern-Gerlach Experiment