improve fallback random algorithm
added string library; more refinements