A little exercise in JS