Added srand() invocation to make sure random loss is really random