improved grped_along_var.py