calc of entropy oprimized