first commit of js version in progress