entropy function complete