new version! split the source code in some files. fix some bugs