javascript now functional