previous problem solved. object can be created outside the function

The problem concerning the object being defined outside of the object is
solved. The problem was situated in the constructor: too many items were
done in the constructor. This has been solved by creating an initiation
method. So it has to be called when starting the program.