shannon's entropy implemented