Added lambda functions for controlling Cov and Mean
Fixed a bug where h_first > h_last