changed all lambdas to be <= not < and >= not >