refactoring histogram code
adding license to readme