added one singleton class for global variables, improved data reading