Simulating quantum mechanics by non-contextual hidden variables