Compleated javascript exercise