Made the example JS code a little more realistic