Finished all functions related to generating random problems.