I don't see how entry->dim and entry->bufw are related like this.  This is just pure hack.

-[Unknown]