optimizations from Andy Mar20