added support for monte carlo averaging