Update libraries
Added comments
Code refactoring