renamed gen_window_cfs to gen_window by passing sql as a param