rewrite function to store code string instead of an object.
console style