added randomness.  still needs work