added function for shannon entropy