My attempt at playing with JavaScript