fixed randi bug and changed so tests are run locally rather than with standard package