Added functionality to calculate Shannon entropy. Modified some Rd output.