added entropy function!