javascripting and functional JS