Changes in code sample

made adjustments in my math