Moving functions to the parent class. Adding a random generator for real numbers.