consolidated some code for computing the globs