changed number generation functions to non-static