a little progress on the js code