more playing around with javascript using the book as the reference