trimmed some functions