fixed primer, small edits to code