quickly reviewed and updated code snippets