trimmed some code