exploring functional coding in js...again!  :)