rewrited the whole program

There is much more sense now.
Meaningfull classes and methods are provided.