add randomizer functionality
Merged.
Removed some extra stuff.