Created entropy function.