new fetures ,refactored and tests.