added geostats code