switching to javascript