implement cutoff caching, style fixes