random implementations of algorithms