adjusted code examples for readability and consistancy