code cleaned and restructed
final stage before dynamic scheme
need somehow to deal the dynamic simulation