added code to calc shannon entropy