created method prepared_code for CodeSample