Improved lazy mean and added javadoc