First pass on CSP

issue #322