moved random from lib to plugin