a new version with some important modifies