1. Modified the code to match Eric Lipperts implementation