fixed mean calc and updated docs