New Version Refactored and itegrate all libraries