Lambda and diamond

updates codes to use Lambda and diamond