added kdb window function