refactored method and updated readme