code refactoring

many changes in this version, new synthax and new python methods